package test;

import java.util.HashMap;
import java.util.Scanner;
import java.util.*;
public class test06 {
        /**
         * 计算int对应二进制中1的个数
         */
        public static void main(String[] args) {
            Scanner in=new Scanner(System.in);
            int n=in.nextInt();
            int result=countBit (n);
            System.out.println(result);

        }
        public static int countBit (int n) {
            String s="";
            //除二取余法
            while(n > 0) {
                int a= n % 2;
                n /= 2;
                s+=Integer.valueOf(a);
            }
            StringBuffer sb=new StringBuffer(s);
            String s2=sb.reverse().toString();
            //打印出这个二进制数字
            System.out.println(s2);
            int count = 0;//统计变量
            char[] array = s2.toCharArray();
            for(int i = 0;i < array.length;i++) {
                if(array[i] == 1);
                    count++;
            }
            return count;

        }

    public static void main1(String[] args) {
        HashMap map = new HashMap();
        map.put("name",null);
        map.put("name","jack");
        System.out.println(map.size());
    }
}
